package br.edu.ufcg.p1.barzin.model;

import java.io.ByteArrayOutputStream;

import android.graphics.Bitmap;

public class Propaganda {

	private int id;

	private Bitmap foto;
	
    
	public Bitmap getFoto() {
		return foto;
	}

	public void setFoto(Bitmap foto) {
		this.foto = foto;
	}

    public byte[] getFotoByteArray() {
    	if (this.getFoto() != null) {
    		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        	this.getFoto().compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
        	return outputStream.toByteArray();
    	}
    	return null;
    }

	public Propaganda(int id) {
		this.id = id;
	}

	public Propaganda() {
	}
	
	public int getId() {
		return id;
	}

}
